write(positions-sp, destination-ket) input-seq
for each index in positions-sp, overwrite the corresponding element in each of the superpositions in the input sequence with destination-ket
if destination-ket is actually a sequence or superposition, we force cast it to a ket
index values start from 1, not 0
negative values are also valid, so -1 is last element, -2 is second last element, etc
if a ket in positions-sp is out of range, or not a number, ignore that ket
Note, write() is somewhat more subtle than the sequence version swrite()
This is due to the desired properties of superpositions
If destination-ket is the empty ket |> then we erase all the corresponding kets from the input superposition
Further, if also given more than one position, then care must be taken when choosing the index positions
Because the relative indices will change after each erasure event
Next, if the destination-ket lines up with the same ket, then just update the coefficient to the new value
Next, if the destination-ket matches another ket already in the superposition, erase the ket at the index, and then update the coeff of the matching ket
Next, if more than one position is given in positions-sp, then process the input superposition one position at a time, using the above rules
Also, note the order of the indices in positions-sp do matter